package model // admin/system/model/user.go

import (
	"time"
)

// User 用户模型
type User struct {
	ID            uint64     `json:"user_id" gorm:"column:user_id;primaryKey;autoIncrement"`
	DeptID        *uint64    `json:"dept_id,omitempty" gorm:"column:dept_id"`
	Username      string     `json:"user_name" gorm:"column:user_name;size:30;uniqueIndex;not null"`
	Nickname      string     `json:"nick_name" gorm:"column:nick_name;size:30;not null"`
	UserType      string     `json:"user_type" gorm:"column:user_type;size:2;default:'00'"`
	Email         string     `json:"email" gorm:"column:email;size:50"`
	Phonenumber   string     `json:"phonenumber" gorm:"column:phonenumber;size:11"`
	Sex           string     `json:"sex" gorm:"column:sex;size:1;default:'0'"`
	Avatar        string     `json:"avatar" gorm:"column:avatar;size:100"`
	Password      string     `json:"-" gorm:"column:password;size:100"`
	Status        string     `json:"status" gorm:"column:status;size:1;default:'0'"`
	DelFlag       string     `json:"-" gorm:"column:del_flag;size:1;default:'0'"`
	LoginIP       string     `json:"login_ip" gorm:"column:login_ip;size:128"`
	LoginDate     *time.Time `json:"login_date,omitempty" gorm:"column:login_date"`
	PwdUpdateDate *time.Time `json:"pwd_update_date,omitempty" gorm:"column:pwd_update_date"`
	CreateBy      string     `json:"create_by" gorm:"column:create_by;size:64"`
	CreatedAt     *time.Time `json:"create_time,omitempty" gorm:"column:create_time"`
	UpdateBy      string     `json:"update_by" gorm:"column:update_by;size:64"`
	UpdatedAt     *time.Time `json:"update_time,omitempty" gorm:"column:update_time"`
	Remark        string     `json:"remark" gorm:"column:remark;size:500"`
}

// TableName 表名
func (User) TableName() string {
	return "sys_user"
}
